package com.shujia.maven.jdbc;

import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.SQLException;
import java.sql.Statement;

public class Demo3largeInsertMysql {
    public static void main(String[] args) throws ClassNotFoundException, SQLException {
        //1.加载驱动
        Class.forName("com.mysql.jdbc.Driver");
        //2.建立连接
        /**
         * jdbc url ===> jdbc:mysql://master:3306/db1?useSSl=false
         */
        Connection conn = DriverManager.getConnection("jdbc:mysql://master:3306/db2?useSSl=false", "root", "123456");
        Statement st = conn.createStatement();
        st.execute("create table 'student_like'(\n"+
                " 'id' int(10) not null comment '学生id',\n"+
                "'name' varchar(10) default null comment '学生姓名',\n"+
                "'age''int(2) default null comment"
                );
    }
}
